package com.wgw.first.utils;

import android.content.Context;
import android.content.SharedPreferences;

/**
 * 存储json
 *
 */
public class CacheUtils {

    public static String getString(Context context, String key) {
        String result = "";
        SharedPreferences sp = context.getSharedPreferences("atguigu", Context.MODE_PRIVATE);
        result = sp.getString(key,"");
        return result;
    }
    public static void putString(Context context, String key, String value) {
        SharedPreferences sp = context.getSharedPreferences("atguigu", Context.MODE_PRIVATE);
        sp.edit().putString(key, value).commit();
    }

}
